-
Notifications
You must be signed in to change notification settings - Fork 619
[TOOL-2773] Fix incorrect caching in useCsvUpload hook #5820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TOOL-2773] Fix incorrect caching in useCsvUpload hook #5820
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5820 +/- ##
=======================================
Coverage 53.34% 53.34%
=======================================
Files 1101 1101
Lines 59124 59124
Branches 4825 4825
=======================================
Hits 31541 31541
Misses 26864 26864
Partials 719 719
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
kien-ngo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Merge activity
|
## Problem solved Fixes: #5791 Problem: User uploads a CSV1 and then uploads a CSV2 - CSV2 is ignored and CSV1's data is sent instead of CSV2 because of incorrect query cache key <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on refactoring the `normalizeQuery` in the `useCsvUpload` hook to improve clarity and consistency in parameter naming. ### Detailed summary - Changed the parameter name from `o` to `item` in the `rawData.map` function for better readability. - Updated the `queryKey` to use `item` directly instead of `o.address`. - Maintained the same functionality while enhancing code clarity. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
453c180 to
cb66be4
Compare

Problem solved
Fixes: #5791
Problem:
User uploads a CSV1 and then uploads a CSV2 - CSV2 is ignored and CSV1's data is sent instead of CSV2 because of incorrect query cache key
PR-Codex overview
This PR focuses on improving the handling of queries in the
useCsvUploadhook by changing the mapping ofrawDatato use a more descriptive variable name and ensuring the correct item is passed to thecheckIsAddressfunction.Detailed summary
mapfunction fromotoitemfor clarity.queryKeyto useitemdirectly instead ofo.address.queryFnpasses the correctitemtocheckIsAddress.